home *** CD-ROM | disk | FTP | other *** search
- ; EXPLAIN1.ASM
- ; ------------
- ; Please explain why the data in this SEPDATA segment get's used as
- ; MALLOC() space when included in a TC program.
- ;
- ; Therefore, how can I get another 64k segment to use as a storage
- ; area for my graphics driver code.
- ; (Without going into HUGE or LARGE memory models!
- ;
-
-
- ASSUME cs:_TEXT, DS:SEPDATA
-
- SEPDATA SEGMENT WORD 'SDATA'
- public overwrite, notile
-
- ;
- ; This data following gets overwritten when TURBO-C uses
- ; MALLOC()'ed data
- ;
- ; Why?? it's in a different segment, isn't this all I have to do?
- ;
-
-
- overwrite db 123
- notile db 000h, 000h, 000h, 000h
- db 000h, 000h, 000h, 000h
- db 000h, 000h, 000h, 000h
- db 000h, 000h, 000h, 000h
-
- corner db 055h, 055h, 040h, 000h
- db 040h, 000h, 040h, 000h
- db 040h, 000h, 040h, 000h
- db 040h, 000h, 040h, 000h
-
- allwhite db 0FFh, 0FFh, 0FFh, 0FFh
- db 0FFh, 0FFh, 0FFh, 0FFh
- db 0FFh, 0FFh, 0FFh, 0FFh
- db 0FFh, 0FFh, 0FFh, 0FFh
-
- imagelist dw notile ; pointers to images
- dw corner
- dw allwhite
- dw 0
-
- map db 9000 dup(?) ; Map array, lists which tile
- ; appears where.
- ; Each entry is an index into
- ; the imagelist file
-
- scrbuf db 16200 dup(?) ; Screen swap buffer
-
- SEPDATA ENDS
-
- _TEXT SEGMENT BYTE PUBLIC 'CODE'
-
- PUBLIC _refreshscr
-
- ;
- ; This is a sample procedure called from TURBO-C which should make use
- ; of the new data segment
- ;
-
- ;
- ; Ignore what this procedure actually does ... it's just for example.
- ;
-
- _refreshscr proc
- push bp
- mov bp,sp
- push ds
- push es
- push si
- push di
- push cx
-
- cli
- mov ax,SEPDATA
- mov ds,ax
-
- mov ax,0B800h
- mov es,ax
- mov si,OFFSET scrbuf
- mov cx,16192
- mov di,0
- rep movsb
- sti
-
- pop cx
- pop di
- pop si
- pop es
- pop ds
- pop bp
- ret
-
- _refreshscr endp
-
- _TEXT ENDS
-
- END